namespace EyeOpen.SampleCms.Web.Contents
{
    using System;

    public static class SectionContents
    {
        private static SectionContentProvider provider;

        public static SectionContentProvider Provider
        {
            get
            {
                if (provider != null)
                {
                    return provider;
                }

                provider =
                    (SectionContentProvider)
                    Activator.CreateInstance(Type.GetType(ConfigurationWrapper.SectionContentProvider));

                return provider;
            }
        }

        public static SectionContent CurrentSectionContent
        {
            get
            {
                return Provider.CurrentSectionContent;
            }
        }

        public static void Save()
        {
            Provider.Save();
        }
    }
}